import struct
from .lower_computer import lower_computer


def set_time(content):
    bytes_data = bytearray.fromhex('EB 90 11 01 00 10')
    utc_ms = content['data']
    time_s = int(utc_ms/1000)
    time_us = int(utc_ms % 1000)*1000
    time_bytes = struct.pack('>QQ', time_s, time_us)
    bytes_data.extend(time_bytes)
    lower_computer.send_bytes(bytes_data)
